package day06;

import java.util.Arrays;

public class MaxOfArrays {
    public static void main(String[] args) {
        int[] arr = {12, 15, 19, 17, 18, 16};
        int max = arr[0];
        for (int i = 1; i < arr.length; i++) {
            if (arr[0] < arr[i]) {
                max = arr[i];
            }
        }
        System.out.println("最大值为" + max);

        arr = Arrays.copyOf(arr, arr.length + 1);
        arr[arr.length - 1] = max;
        System.out.println(max);

    }

public static void hell() {
        System.out.println("helllo");

}


}
